package Package.Map.traverse;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Traverse {
    public static final void Traverse(){
        Map<Integer,String> map=new HashMap<Integer,String>();
        map.put(10001,"ChangCun");
        map.put(10002,"YangYinTao");
        map.put(10003,"LinQingXia");
        Set<Integer> keyset=map.keySet();
        for (Integer key:keyset
             ) {
            System.out.println(map.get(key));
        }
        Set<Map.Entry<Integer,String>> key=map.entrySet();
        for (Map.Entry<Integer,String> maps: key
             ) {
            System.out.println(maps.getKey()+"-----"+maps.getValue());
        }
    }
}
